<?php
require_once "libraries/utilities/function.php";
$path = "data/films.txt";
$full_path = realpath($path);
$fimls = mreadFile($full_path);
//echo 'chuyen trang';
?>

<form method="POST">
    <?php
    for ($i = 0; $i < count($fimls); $i++) {
        $a = trim($fimls[i], "t\n\r");
        $fimls=  explode(";", $a);
        if($_GET["if"]==$mang[0]){
            ?>
    Name: <input type="text" name="fiml-title" id ="fiml-title" value="<?php if(isset($mang[2])) echo $mang[2];?>">
    rate: <input type="text" name="fiml-title" id ="fiml-title" value="<?php if(isset($mang[3])) echo $mang[3];?>">
    <br>
    <img src="public/images/films/<?php echo $mang[i];?>" 
         
         <input type="submit" name="submit" value="save"><br>
    
    <?php }} ?>
        
    </form>
<?php if(isset($_POST["submit"]))    ?>